/*!
 * \file WtHelper.cpp
 * \project	WonderTrader
 *
 * \author Wesley
 * \date 2020/03/30
 *
 * \brief
 */
#include "WtHelper.h"

#include "../Share/StrUtil.hpp"

#ifdef _MSC_VER
#include <direct.h>
#else // UNIX
#include <unistd.h>
#endif

std::string WtHelper::_bin_dir;

const char* WtHelper::get_cwd() {
    static std::string _cwd;
    if (_cwd.empty()) {
        char buffer[255];
#ifdef _MSC_VER
        _getcwd(buffer, 255);
#else // UNIX
        getcwd(buffer, 255);
#endif
        _cwd = buffer;
        _cwd = StrUtil::standardisePath(_cwd);
    }
    return _cwd.c_str();
}